#include "BallFeederControl.h"
#include "WPILib.h"

BallFeederControl::BallFeederControl() {
	// Use requires() here to declare subsystem dependencies
	Requires(ballFeeder);
}

// Called just before this Command runs the first time
void BallFeederControl::Initialize() {
}

// Called repeatedly when this Command is scheduled to run
void BallFeederControl::Execute() {
	if(oi->isPickingBalls())
	{
		oi->setBallFeederStatus(false);
	    apb = new AbortBallsPickUp();
	    apb->Start();
	}
	else
	{
		oi->setBallFeederStatus(true);
	    pb = new PickUpBalls();
	    pb->Start();
	}
}

// Make this return true when this Command no longer needs to run execute()
bool BallFeederControl::IsFinished() {
	return true;
}

// Called once after isFinished returns true
void BallFeederControl::End() {
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void BallFeederControl::Interrupted() {
}
